interface UseThrottleType{
    (callback : Function , delay : number) : void
}

export let useThrottle : UseThrottleType = (callback,delay) =>{
    let timer :any = null;
    return function(){
        clearTimeout(timer)
        timer = setTimeout(() => {
            callback()
        }, delay);
    }
}